import request from '@/utils/request'
import {projectApiUrl} from '../config'
import request2 from '@/utils/request2'
/**
 * 分包商季度考核列表
 * @param parameter
 */
export function getQuarterAssessmentList(parameter){
  return request2({
    url:  projectApiUrl+'/quarterly-review/list',
    method: 'post',
    data: parameter
  })
}


export function batchList(parameter) {
  return request2({
    url: projectApiUrl + '/quarterly-review/batchList',
    method: 'post',
    data: parameter
  })
}
export function exportList(params,data) {
  return request2({
    url: projectApiUrl + '/quarterly-review/exportList',
    // url: projectApiUrl + '/quarterly-review/exportList',
    method: 'get',
    params
  })
}

//月度批量考核打分
export function assessmentBatchDetails(data) {
  return request2({
    url: projectApiUrl + '/quarterly-review/quarterly-update-score',
    method: 'post',
    data
  })
}

export function querySafeTyScore(data) {
  return request2({
    url: projectApiUrl + '/quarterly-review/query-safety-score',
    method: 'post',
    data
  })
}
export function batchHeader(params) {
  return request2({
    url: projectApiUrl + '/quarterly-review/batchHeader/' + params.id,
    method: 'get',
    params
  })
}

/**
 * 月度考核提交审核
 *
 */
export function getMonthAapprove(data) {
  return request({
    url: projectApiUrl + '/quarterly-review/assessment-details',
    method: 'post',
    data: data
  })
}

/**
 * 编辑分包商月度考核评分
 * @param data
 */
export function editMothAssessment(data) {
  return request({
    url: projectApiUrl + '/subcontractors/month-assessment',
    method: 'post',
    data: data
  })
}
/**
 * 查看分包商月度考核详情--内容信息编辑
 * @param id
 */
export function getMonthContents(data) {
  return request({
    url: projectApiUrl + '/quarterly-review/assessment-edit-details-content',
    method: 'get',
    params: data
  })
}

/**
 * 分包商月度考核时间
 * @param parameter
 */
export function getMonthAssessmentTime(parameter) {
  return request({
    url: projectApiUrl + '/quarterly-review/assessmentTime',
    method: 'get',
    params: parameter
  })
}

/**
 * 打印月度考核数据
 * @param data
 */
export function getMothAssessmentDoc(data) {
  return request({
    url: '/cscec-project-business/quarterly-review/doc',
    method: 'get',
    params: data
  })
}

export function listTotalQuery(params) {
  return request2({
    // url: projectApiUrl + '/quarterly-review/listTotalQuery',
    url: projectApiUrl + '/quarterly-review/quarterly-listTotalQuery/list',
    method: 'post',
    data:params
  })
}

export function serviceUpdate(parameter) {
  return request2({
    url: projectApiUrl + '/quarterly-review/service-update',
    method: 'post',
    data: parameter
  })
}
export function queryBatchButton(parameter) {
  return request2({
    url: projectApiUrl + '/quarterly-review/queryBatchButton',
    method: 'post',
  })
}

/**
 * 查看分包商季度考核详情--表头信息
 * @param id
 */
export function getMonthHeaders(data){
  return request2({
    url: projectApiUrl+'/quarterly-review/quarterly-details-header',
    method: 'get',
    params:data
  })
}


/**
 * 查看分包商季度考核详情--内容信息
 * @param id
 */
export function getMonthContent(data){
  return request2({
    url: projectApiUrl+'/quarterly-review/quarterly-details-content',
    method: 'get',
    params:data
  })
}


/**
 * 编辑分包商季度考核详情--内容信息
 * @param id
 */
export function getMonthContentEdit(data){
  return request({
    url: projectApiUrl+'/quarterly-review/quarterly-edit-details-content',
    method: 'get',
    params:data
  })
}



/**
 * 查看分包商季度考核详情
 * @param id
 */
export function getQuarterScores(data){
  return request({
    url: projectApiUrl+'/subcontractors/quarter/assessment-details',
    method: 'get',
    params:data
  })
}

/**
 * 分包商季度考核统计
 * @param
 */
export function getQuarterTotal(data){
  return request({
    url: projectApiUrl+'/quarterly-review/quarterly-listTotalQuery',
    method: 'get',
    data:data
  })
}

/**
 * 分包商季度考核详情统计
 * @param
 */
export function getQuarterDetailsTotal(id){
  return request({
    url: projectApiUrl+'/subcontractors/quarter/details-total/'+id,
    method: 'get',
    id
  })
}



/**
 * 分包商季度考核基本信息
 * @param data
 */
export function getQuarterDetails(id){
  return request2({
    url: projectApiUrl+'/quarterly-review/details/'+id,
    method: 'get',
    id
  })
}


/**
 * 分包商季度考核提交审核
 * @param data
 */
export function quarterReview(data){
  return request({
    url: projectApiUrl+'/quarterly-review/quarterly-score',
    method: 'post',
    data: data
  })
}


/**
 * 编辑分包商季度考核评分
 * @param data
 */
export function editQuarterAssessment(data){
  return request({
    url: projectApiUrl+'/subcontractors/quarter-assessment',
    method: 'post',
    data: data
  })
}

/**
 * 编辑分包商季度考核评分
 * @param data
 */
export function getSignImgs(data){
  return request({
    url: projectApiUrl+'/subcontractors/signImg',
    method: 'get',
    params: data
  })
}


/**
 * 分包商季度根据时间查询信息
 * @param data
 */
export function getQuarterly(data){
  return request({
    url: projectApiUrl+'/quarterly-review/quarterly',
    method: 'get',
    params: data
  })
}


/**
 * 打印月度考核数据
 * @param data
 */
export function getQuarterAssessmentDoc(data){
  return request({
    url: '/cscec-project-business/quarterly-review/doc',
    method: 'get',
    params: data
  })
}

/**
 * 批量打印季度考核数据
 * @param data
 */
export function quarterlyReviewDocPrintBatch(data) {
  return request({
    url: projectApiUrl + '/quarterly-review/doc-print-batch',
    method: 'post',
    data
  })
}
